import zmq


def worker():
    context = zmq.Context()
    socket = context.socket(zmq.PULL)
    socket.connect("tcp://localhost:5558")
    data = socket.recv()
    with open("data.bin", "wb") as f:
        f.write(data)

    print("done.")


if __name__ == "__main__":
    worker()
